Skip to content

Add address space support and tests for overlap errors - #1602

Open
bratpiorka wants to merge 6 commits into
oneapi-src:mainfrom
bratpiorka:rrudnick_tracking_overlap_fix
Open

Add address space support and tests for overlap errors#1602
bratpiorka wants to merge 6 commits into
oneapi-src:mainfrom
bratpiorka:rrudnick_tracking_overlap_fix

Conversation

@bratpiorka

Copy link
Copy Markdown
Contributor

This pull request introduces new functionality for identifying and working with process-local address spaces in memory providers, updates the UMF versioning, and improves error handling for ambiguous memory deallocations. The changes primarily add support for querying and specifying address space identities, update provider operation interfaces, and implement the new logic in several memory providers.

Key changes include:

Address Space Identity Support

  • Introduced the umf_memory_provider_address_space_t struct to represent process-local address space identities, and added the UMF_ADDRESS_SPACE_NAMESPACE_HOST token for host address spaces.
  • Added the umfMemoryProviderGetAddressSpace API and corresponding provider operation to retrieve a provider's address space identity. Default and provider-specific implementations were added for CUDA, devdax, file, and fixed memory providers.

Provider Interface and Versioning Updates

  • Updated the provider ops structure version to 1.3 and incremented the core UMF version to 1.1 to reflect the new API and interface changes.
  • Ensured backward compatibility and proper defaulting for the new get_address_space operation in the provider ops initialization logic.

Fixed Memory Provider Enhancements

  • Added the ability to set the address space for fixed memory providers via a new parameter API (umfFixedMemoryProviderParamsSetAddressSpace) and ensured the address space is initialized and propagated correctly.

Ambiguous Free Error Handling

  • Added a new error code UMF_RESULT_ERROR_AMBIGUOUS and updated umfFree to detect and report ambiguous frees when multiple allocations match a pointer, improving safety and diagnostics.

@bratpiorka
bratpiorka force-pushed the rrudnick_tracking_overlap_fix branch 14 times, most recently from 0bee7cf to 48f8058 Compare August 27, 2026 10:01
@bratpiorka
bratpiorka force-pushed the rrudnick_tracking_overlap_fix branch 2 times, most recently from 800c5a9 to c21c5e7 Compare September 1, 2026 07:40
@bratpiorka
bratpiorka marked this pull request as ready for review September 2, 2026 08:28
@bratpiorka
bratpiorka requested a review from a team as a code owner September 2, 2026 08:28
@bratpiorka

Copy link
Copy Markdown
Contributor Author

@oneapi-src/unified-memory-framework-maintain nightly run passes: https://github.com/oneapi-src/unified-memory-framework/actions/runs/33483230439?pr=1602

@ldorau ldorau left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will continue this review on Monday ...

Comment on lines -42 to -44
// Multilevel maps are needed to support the case
// when one memory pool acts as a memory provider
// for another memory pool (nested memory pooling).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would leave this comment, it can be useful.

Comment on lines +1125 to +1126
for (tracker_address_space_t *address_space = hTracker->address_spaces;
address_space; address_space = address_space->next) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't utils_atomic_load_acquire_ptr be used here to set address_space ?

Comment on lines +1722 to +1723
for (tracker_address_space_t *address_space = TRACKER->address_spaces;
address_space; address_space = address_space->next) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't utils_atomic_load_acquire_ptr be used here to set address_space ?

Comment thread docs/config/examples.rst
address-space namespace, and different tokens for independent namespaces. The
token must remain at a stable address for as long as any provider using it
exists. Other implementations can use the address of a private static object,
for example::

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you've doubled : sign.

ze_memory_provider_t *ze_provider = provider;
if (ze_provider->memory_type == ZE_MEMORY_TYPE_HOST) {
address_space->namespace_token = NULL;
address_space->context = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: L0 host alloc functions take a context param.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants